/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rlpw.swing;

import java.util.List;

/**
 *
 * @author weinpau
 */
public class DefaultCheckModel<T> extends StateModel<T> implements CheckModel<T> {

    public DefaultCheckModel(View<T> view) {
        super(view);
    }

    public boolean isChecked(int index) {
        return getState(index);
    }

    public boolean isChecked(T element) {
        return getState(element);
    }

    public void setChecked(int index, boolean check) {
        setState(index, check);
    }

    public void setChecked(T element, boolean check) {
        setState(element, check);
    }

    public void setAllChecked(boolean check) {
        setAllState(check);
    }

    public List<T> getChecked() {
        return getStates();
    }

    public int countChecked() {
        return size();
    }
}
